export const config = {
  map: '',
  loca: '',
  AMap: ''
};
export const apiConfig = {
  url: 'https://thirdparty.test.nbpitech.com'
};

export const imageUrl = process.env.NODE_ENV == 'development' ? 'https://thirdparty.test.nbpitech.com' : `${window.location.protocol}//${window.location.host}`;

export const globalConfig = {
  map: {
    key: 'c9e01f5d9b1551c4a0a8072e3eafd314',
    securityJsCode: '81f8891409a23e4df0ca72353e9783e8',
    version: '1.4.15',
    mapStyle: 'amap://styles/light', // 默认light 可选dark
    // 中心点 不填默认宁波市中心
    center: [121.352816, 29.82502],
    zoomEnable: true, // 可缩放
    zoom: 9, // 缩放比例
    dragEnable: true, // 可拖动 默认true
    showBuildingBlock: false,
    showLabel: false
  },
  clickable: false,
  areaCode: '',
  mapLayerUrl: '',
  mapNBImageUrl: '',
  hideMapLayer: false,
  autoMoveEnable: false, // 驾驶舱点击自动定位到当前
  polygonStyle: {
    strokeColor: '#fff',
    fillOpacity: 0.1
  },
  polygonLabelStyle: {
    enable: true,
    // offset: [0, 0],
    style: {
      'font-size': '18px'
    }
  },
  polygonLineStyle: {
    // 外边透明度
    strokeOpacity: 1
  },
  openLimit: false,
  limitX: 0,
  limitY: 0
};

export const options = {
  data: [],
  unit: '',
  mapType: 'cockpitMap',
  globalConfig,
  selectName: {
    color: '',
    name: []
  }
};

export const customOptions = {};

const themeColor = {
  light: 'rgb(82, 167, 243)',
  dark: 'rgba(0, 50, 117, 0.8)'
};

const themeActiveColor = {
  light: 'rgb(13,71,157)',
  dark: 'rgb(1, 31, 88)'
};

const themeSelectedColor = {
  light: 'rgb(63,222,230)',
  dark: 'rgb(63,222,230)'
};

const sideTopColorTheme = {
  light: '#52a7f3',
  dark: 'rgb(7,45,114)'
  // dark: 'rgba(7,79,132, 0.9)'
};

const sideBottomColorTheme = {
  light: 'rgb(13,71,157)',
  dark: 'rgb(7,45,114)'
};

const lineOpcityTheme = {
  light: 1,
  dark: 0.3
};

const sideOpcityTheme = {
  light: 1,
  dark: 0.7
};

export function getColor(globalConfig) {
  return {
    color: themeColor[globalConfig.theme],
    colorActive: themeActiveColor[globalConfig.theme],
    colorSelected: themeSelectedColor[globalConfig.theme],
    sideTopColor: sideTopColorTheme[globalConfig.theme],
    sideBottomColor: sideBottomColorTheme[globalConfig.theme],
    lineOpcity: lineOpcityTheme[globalConfig.theme],
    sideOpcity: sideOpcityTheme[globalConfig.theme]
  };
}
